from threading import Thread
from universal.custom.ini_file import ODvision_config,ODModule_config
class MyThread(Thread):

    def __init__(self):
        Thread.__init__(self)
        self.device_list = ["cpu"]

    def run(self):
        if ODModule_config.read_value('FTP', 'tab2') == "1" or ODModule_config.read_value('TrainAndTest', 'page') == "1":
            from DeepLearning.project.util_my import get_devices
            self.device_list = get_devices() #设备
        else:
            self.device_list = ['cpu'] #设备
    def get_result(self):
        return self.device_list

# time1 = time.time()
# thd1 = MyThread()
# thd1.start()
# # thd1.join()
# print('get_devices is ',time.time() - time1)
